package so.wy.servicecenter.businessbed.service.hospital.dto;

import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data;
import lombok.NoArgsConstructor;
import so.wy.servicecenter.businessbed.dao.rdb.hospital.hospital_rent_time.HospitalRentTimeDO;

import java.util.Date;

/**
* @author wdl
* @date 2020-04-08
*/
@Data
@NoArgsConstructor
public class HospitalRentTimeDTO{

	/** 主键ID */
	private Long id;
	private Long hospitalId;
	/** 站点Number */
	@JSONField(format="HH:mm:ss")
	private Date timeStart;
	/** 医院名称 */
	@JSONField(format="HH:mm:ss")
	private Date timeEnd;

	/** 是否启用 */
	private Integer isOpen;
	/** 排序 */
	private Integer sortNum;

	public HospitalRentTimeDTO(HospitalRentTimeDO hospitalRentTimeDO){
		if(hospitalRentTimeDO==null){
			return ;
		}

		this.id = hospitalRentTimeDO.getId();
		this.hospitalId = hospitalRentTimeDO.getHospitalId();
		this.timeStart = hospitalRentTimeDO.getTimeStart();
		this.timeEnd = hospitalRentTimeDO.getTimeEnd();
		this.isOpen = hospitalRentTimeDO.getIsOpen();
		this.sortNum = hospitalRentTimeDO.getSortNum();
	}

	public HospitalRentTimeDO convert2DO(){
		HospitalRentTimeDO hospitalRentTimeDO = new HospitalRentTimeDO();
		hospitalRentTimeDO.setId(this.id);
		hospitalRentTimeDO.setHospitalId(this.hospitalId);
		hospitalRentTimeDO.setIsOpen(this.isOpen);
		hospitalRentTimeDO.setTimeStart(this.timeStart);
		hospitalRentTimeDO.setTimeEnd(this.timeEnd);
		hospitalRentTimeDO.setSortNum(this.sortNum);
		return hospitalRentTimeDO;
	}

}
